#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 10010;
int n, aim;
int a[N];
int dp[N];
int main() {
    memset(dp, 0x3f3f3f3f, sizeof dp);
    cin >> n >> aim;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    dp[0] = 0;
    for (int i = 1; i <= aim; i++) {
        for (int j = 1; j <= n; j++) {
            if (a[j] <= i) {
                dp[i] = min(dp[i], dp[i - a[j]] + 1);
            }
        }
    }
    if (dp[aim] != 0x3f3f3f3f) {
        cout << dp[aim] << endl;
    } else {
        cout << -1 << endl;
    }
    return 0;
}